import request from '@/config/axios'

// 生活圈-商铺-返利算法的运营轮次记录 VO
export interface CircleStoreRoundRecordVO {
  id: number // 记录ID
  areaId: string // 区域编号
  areaName: string // 区域名称
  storeId: string // 区域内的店铺编号,多个用逗号分割
  storeName: string // 区域内店铺名称,多个使用逗号分割
  batchId: string // 批次号
  currentRebateRound: number // 当前返利期数
  addRounds: number // 累计轮次
  totalAddRounds: number // 累计累计轮次
  lastOperatingLimit: number // 上一轮的操作限制
  nextOperatingLimit: number // 下一轮的操作限制
}

// 生活圈-商铺-返利算法的运营轮次记录 API
export const CircleStoreRoundRecordApi = {
  // 查询生活圈-商铺-返利算法的运营轮次记录分页
  getCircleStoreRoundRecordPage: async (params: any) => {
    return await request.get({ url: `/trade/circle-store-round-record/page`, params })
  },

  // 查询生活圈-商铺-返利算法的运营轮次记录详情
  getCircleStoreRoundRecord: async (id: number) => {
    return await request.get({ url: `/trade/circle-store-round-record/get?id=` + id })
  },

  // 新增生活圈-商铺-返利算法的运营轮次记录
  createCircleStoreRoundRecord: async (data: CircleStoreRoundRecordVO) => {
    return await request.post({ url: `/trade/circle-store-round-record/create`, data })
  },

  // 修改生活圈-商铺-返利算法的运营轮次记录
  updateCircleStoreRoundRecord: async (data: CircleStoreRoundRecordVO) => {
    return await request.put({ url: `/trade/circle-store-round-record/update`, data })
  },

  // 删除生活圈-商铺-返利算法的运营轮次记录
  deleteCircleStoreRoundRecord: async (id: number) => {
    return await request.delete({ url: `/trade/circle-store-round-record/delete?id=` + id })
  },

  // 导出生活圈-商铺-返利算法的运营轮次记录 Excel
  exportCircleStoreRoundRecord: async (params) => {
    return await request.download({ url: `/trade/circle-store-round-record/export-excel`, params })
  },
}
